package br.ufrj.ppgi.greco.model.dao;

import java.util.List;

import javax.persistence.EntityManager;

import br.com.caelum.vraptor.ioc.Component;
import br.ufrj.ppgi.greco.model.entity.EntityDynamicDataProperty;

@Component
public class DAODynamicDataProperty extends DAOGeneric<EntityDynamicDataProperty>
{
	
	private EntityManager em;

	public DAODynamicDataProperty(EntityManager em)
	{
		super(em);
		this.em = em;
	}
	
	@SuppressWarnings("unchecked")
	public List<String> getServices()
	{
		String queryCreate = "select distinct o.service from " + this.getClass().getSimpleName() + " o";
		return this.em.createQuery(queryCreate).getResultList();
	}
	
}
